package com.domain.VO;

import com.common.util.StringUtil;
import com.domain.lifecycle.SafeCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 大忽悠
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class FlightInfoVO implements SafeCheck {
    /**
     * 航空公司名
     */
    private String companyName;

    /**
     * 机型
     */
    private String planeType;

    /**
     * 出发城市
     */
    private String departureCity;

    /**
     * 到达城市
     */
    private String arriveCity;

    @Override
    public void insertCheck() {
       if(StringUtil.isNullOrEmpty(companyName)
               || StringUtil.isNullOrEmpty(planeType)
               || StringUtil.isNullOrEmpty(departureCity)
               || StringUtil.isNullOrEmpty(arriveCity)){
           throw new IllegalArgumentException("参数不完整");
       }
    }
}
